import request from '@/utils/request';

/**
 * 获取分类数据列表
 * @returns {Promise<any>}
 */
export const getClassifies = async (data) => {
  const options = {
    params: data,
  };
  return request('/admin/classifies', options);
};

/**
 * 获取分类的详情
 * @returns {Promise<any>}
 */
export const getClassifiesDetail = async (id) => {
  return request(`/admin/classifies/${id}`,);
};

/**
 * 修改分类的状态
 * @returns {Promise<any>}
 */
export const editClassifiesStatus = async (id) => {
  return request.patch(`/admin/classifies/${id}/status`);
};

/**
 * 修改分类的数据
 * @returns {Promise<any>}
 */
export const editClassifies = async (id,data) => {
  return request.put(`/admin/classifies/${id}`, {data});
};

/**
 * 添加分类数据
 * @returns {Promise<any>}
 */
export const addClassifies = async (data) => {
  return request.post('/admin/classifies', {data});
};

